package free.order.security.model;

import java.util.HashSet;
import java.util.Set;

/**
 * @author cac
 */
public class User {

	// Fields

	private Integer id;

	private String loginid;

	private String passwd;

	private String name;

	private String email;

	private String region;

	private String status;

	private String descn;

	private Set roles = new HashSet(0);

	// Constructors

	/**
	 * default constructor
	 */
	public User() {
	}

	/**
	 * minimal constructor
	 */
	public User(String loginid, String passwd, String name, String email) {
		this.loginid = loginid;
		this.passwd = passwd;
		this.name = name;
		this.email = email;
	}

	/**
	 * full constructor
	 */
	public User(String loginid, String passwd, String name, String email, String status, String descn, Set roles) {
		this.loginid = loginid;
		this.passwd = passwd;
		this.name = name;
		this.email = email;
		this.status = status;
		this.descn = descn;
		this.roles = roles;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getLoginid() {
		return this.loginid;
	}

	public void setLoginid(String loginid) {
		this.loginid = loginid;
	}

	public String getPasswd() {
		return this.passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Set getRoles() {
		return this.roles;
	}

	public void setRoles(Set roles) {
		this.roles = roles;
	}

	public boolean isEnabled() {
		return (this.status != null && !this.status.equals("0"));
	}

	public String getRegion() {
		return region;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public String getDescn() {
		return descn;
	}

	public void setDescn(String descn) {
		this.descn = descn;
	}
}

